/**
 * 用户相关API
 */

const http = uni.$u.http;

const userApi = {
	
	// 获取用户基本信息
	userInfo: params => http.get('/member/user/get', { params }), 
	
	// 修改用户信息
	editUserInfo: data => http.put('/member/user/update', data), 
	
	// 获取钱包信息 
	userWallet: params => http.get('/pay/wallet/get', { params }), 
	
	// 获取充值记录
	userRechageLog: params => http.get('/pay/wallet-recharge/page', { params }), 
	
	// 获取钱包统计流水
	userWalletSummary: params => http.get(`/pay/wallet-transaction/stat/summary`, { params }), 
	
	// 获取钱包流水记录
	userWalletLog: params => http.get('/pay/wallet-transaction/page', { params }), 
	
	// 获取提现记录
	userWithdrawLog: params => http.get('/pay/wallet-withdraw/withdrawal-records', { params }),
	
	// 申请提现
	userWithdrawCreate: data => http.post('/pay/wallet-withdraw/withdraw', data),
	
	// 获取支付渠道
	userPayWayList: params => http.get('/pay/channel/get-enable-code-list', { params }), 
	
	// 获取钱包充值套餐
	userWallerMoneyList: params => http.get('/pay/wallet-recharge-package/list', { params }), 
	
	// 发起充值
	userRechargeCreate: data => http.post('/pay/wallet-recharge/create', data),
	
	// 提交支付订单
	submitOrder: data => http.post('/pay/order/submit', data), 
	
	// 获取会员
	
	// 获取车辆列表
	userVehicleList: () => http.get('/user-vehicle/list'), 
	
	// 添加车辆
	addUserVehicle: data => http.post('/user-vehicle/add', data), 
	
	// 删除车辆
	delUserVehicle: data => http.delete('/user-vehicle/delete/'+ data.id), 
	
	// 修改车辆
	editUserVehicle: data => http.post('/user-vehicle/update', data), 
	
	// 获取站内信未读数量
	messageUnreadCount: params => http.get('/me/get-unread-count', { params }),  
	
	// 站内信列表
	messageList: params => http.get('/me/my-page', { params }), 
	
	// 标记站内信已读
	markerMessageReadStatus: data => http.put('/me/update-all-read', data),
	
	// 获取服务热线
	serviceHotline: params => http.get('/me/hotline', { params }), 
	
	// 获取常见问题
	faqList: params => http.get('/me/faq/list', { params }), 
	
	// 绑定提现账号
	addWithdrawalAccount: data => http.post('/pay/withdrawal-account/add', data),
	
	// 修改提现账号
	editWithdrawalAccount: data => http.put('/pay/withdrawal-account/update/' + data.id, data),
		
	// 获取提现账号
	getWithdrawalAccount: params => http.get('/pay/withdrawal-account/default', { params }),
	
	// 获取vip分类 
	getVipList: params => http.get('/member/vip-card/list', { params }),
	
	// 开通vip
	purchaseVipCard: data => http.post('/member/vip-card/purchase', data),
	
	// 账号注销
	accountCancel: params => http.get('/member/user/unregister', { params }),
	
	// 创建个人充电桩
	createMinePile: data => http.post('/api/charging-user-pile/create', data),
	
	// 获取个人充电桩
	getMinePile: params => http.get('/api/charging-user-pile/page', { params }),
	
	// 更新个人充电桩
	updateMinePile: data => http.put('/api/charging-user-pile/update', data),
	
	// 获取个人充电桩详情
	getMinePileDetail: params => http.get('/api/charging-user-pile/get', { params }),
	
	// 删除个人充电桩
	
	// 预约充电
	reservationMinePile: data => http.post('/charging-schedule/add', data),
	
	// 获取预约充电详情
	pileScheduleDetail: params => http.get('/charging-schedule/list', { params }),
	
	isFleetUser: () => http.get('/charging-fleet/isFleetUser'),
	
	getFleetInfo: () => http.get('/charging-fleet/getFleetInfo'),
	
	editUserMobile: data => http.put('/member/user/update-mobile', data),
	
	editUserEmail: data => http.put('/member/user/update-email', data),
}

export default userApi